package com.yun2.bms.model;

import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;

import java.util.Date;

/**
 * author: youli
 * qq: 27855162@qq.com
 * date: 2020/6/15
 */

public class Lend {

    private final SimpleIntegerProperty id = new SimpleIntegerProperty();
    private final SimpleIntegerProperty userId = new SimpleIntegerProperty();
    private final SimpleIntegerProperty bookId = new SimpleIntegerProperty();
    private final SimpleObjectProperty lendDate= new SimpleObjectProperty();

    //附加一些字段，是界面需要的字段。
    private final SimpleStringProperty userName = new SimpleStringProperty("");
    private final SimpleStringProperty bookName = new SimpleStringProperty("");
    private final SimpleObjectProperty returnDate = new SimpleObjectProperty();
    private final SimpleIntegerProperty expireDays = new SimpleIntegerProperty();


    public Lend() {
    }

    public Lend(Integer userId, Integer bookId, Date lendDate) {
        this.setUserId(userId);
        this.setBookId(bookId);
        this.setLendDate(lendDate);
    }

    public Lend(Integer id, Integer userId, Integer bookId, Date lendDate) {
        this.setId(id);
        this.setUserId(userId);
        this.setBookId(bookId);
        this.setLendDate(lendDate);
    }

    public int getId() {
        return id.get();
    }

    public SimpleIntegerProperty idProperty() {
        return id;
    }

    public void setId(int id) {
        this.id.set(id);
    }

    public int getUserId() {
        return userId.get();
    }

    public SimpleIntegerProperty userIdProperty() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId.set(userId);
    }

    public int getBookId() {
        return bookId.get();
    }

    public SimpleIntegerProperty bookIdProperty() {
        return bookId;
    }

    public void setBookId(int bookId) {
        this.bookId.set(bookId);
    }

    public Object getLendDate() {
        return lendDate.get();
    }

    public SimpleObjectProperty lendDateProperty() {
        return lendDate;
    }

    public void setLendDate(Object lendDate) {
        this.lendDate.set(lendDate);
    }

    public String getUserName() {
        return userName.get();
    }

    public SimpleStringProperty userNameProperty() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName.set(userName);
    }

    public String getBookName() {
        return bookName.get();
    }

    public SimpleStringProperty bookNameProperty() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName.set(bookName);
    }

    public Object getReturnDate() {
        return returnDate.get();
    }

    public SimpleObjectProperty returnDateProperty() {
        return returnDate;
    }

    public void setReturnDate(Object returnDate) {
        this.returnDate.set(returnDate);
    }

    public int getExpireDays() {
        return expireDays.get();
    }

    public SimpleIntegerProperty expireDaysProperty() {
        return expireDays;
    }

    public void setExpireDays(int expireDays) {
        this.expireDays.set(expireDays);
    }
}
